<template>
  <!--  <h1>Hello App!</h1>-->
  <!--  <p>-->
  <!-- use the router-link component for navigation. -->
  <!-- specify the link by passing the `to` prop. -->
  <!-- `<router-link>` will render an `<a>` tag with the correct `href` attribute -->
  <!--    <router-link to="/">Go to Home</router-link>-->
  <!--    <router-link to="/about">Go to About</router-link>-->
  <!--  </p>-->
  <!-- route outlet -->
  <!-- component matched by the route will render here -->
  <h1>Ajax</h1>
  <div v-for="(item,i) in store.state.DzList" :key="i">
    <p>{{ item.text }}</p>
  </div>

</template>

<script>
import store from './store/index.js'
import {getHello} from './api/default/test'

export default {
  name: 'App',

  provide: {
    store
  },
  setup() {
    // let api = 'https://api.apiopen.top/getJoke?page=1&count=10&type=text'
    // fetch(api).then(res => res.json()).then((res) => {
    //   console.log(res)
    //   store.serDzList(res.result)
    //   console.log(store.state.DzList)
    // });

    getHello().then((res)=>{
      console.log(res)
    })
    // axios({
    //   url: 'https://www.baidu.com'
    // })

    console.log(1)
    return {
      store
    }
  },
  mounted() {

  }
}
</script>

<style scoped>
/* 样式 */
.d1 {
  color: blue;
}
</style>